package com.lin.androidgame21;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;

/***

 *Create By LWL Write

 **/

public class Talk {
    private String talkName ;
    private String talkContent ;

    public Talk(String talkName, String talkContent) {
        this.talkName = talkName;
        this.talkContent = talkContent;
    }
    public void draw(Canvas canvas, Paint paint){
        paint.setColor(Color.RED);
        paint.setStyle(Paint.Style.STROKE);
        paint.setStrokeWidth(2);
        RectF rectF = new RectF();
        rectF.set(200,500,1080,700);
        canvas.drawRoundRect(rectF,40,40,paint);
        paint.setStyle(Paint.Style.FILL);
        paint.setColor(Color.argb(100,0,0,100));
        canvas.drawRoundRect(rectF,40,40,paint);
        rectF.set(220,520,400,565);
        paint.setColor(Color.CYAN);
        paint.setStyle(Paint.Style.STROKE);
        canvas.drawRoundRect(rectF,20,20,paint);
        paint.setStyle(Paint.Style.FILL);
        paint.setColor(Color.argb(100,100,0,0));
        canvas.drawRoundRect(rectF,20,20,paint);
        paint.setColor(Color.YELLOW);
        paint.setTextAlign(Paint.Align.CENTER);
        paint.setTextSize(32);
        canvas.drawText(talkName,310,555,paint);
        paint.setColor(Color.WHITE);
        paint.setTextSize(24);
        paint.setTextAlign(Paint.Align.LEFT);
        for (int i = 0; i <= talkContent.length()/33; i++) {
            canvas.drawText(talkContent,33*i,Math.min(33*(i+1),talkContent.length()),
                    240,600+50*i,paint);
        }
        paint.setColor(Color.MAGENTA);
        canvas.drawText("单机继续",950,680,paint);
    }
}
